package org.slf4j.impl;

import java.util.concurrent.ConcurrentHashMap;

import org.slf4j.ILoggerFactory;
import org.slf4j.Logger;

public class MyLoggerFactory implements ILoggerFactory{
    
    private ConcurrentHashMap<String, Logger> loggers = new ConcurrentHashMap<String, Logger>();

    public Logger getLogger(String name) {
        Logger old = loggers.get(name);
        if (old != null) {
            return old;
        }
        Logger newInstance = new MyLoggerAdapter(name);
        loggers.putIfAbsent(name, newInstance);
        return loggers.get(name);
    }
}
